package com.linln.component.thymeleaf.utility;

import com.linln.common.utils.ReflectUtils;

import java.util.Map;

public class EntityUtils {
    public Object readField(Object entity, Object fieldName) {
        if (entity instanceof Map) {
            return ((Map) entity).get(fieldName);
        } else {
            return ReflectUtils.readField(entity, fieldName+"");
        }
    }
}
